<script type="text/javascript">

 function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}
	
	function checkInt(e) { 
		var key; 
        var keychar;
		if (window.event) 
			key = window.event.keyCode; 
                else if (e) 
                	key = e.which;
                else 
                	return true;
                keychar = String.fromCharCode(key);
                keychar = keychar.toLowerCase(); 
                // control keys 
                if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) ) 
                	return true;
                // numbers 
                else if ((("0123456789").indexOf(keychar) > -1)) 
                	return true; 
                else 
                	return false;
	}
	
	function enableOthers() {
		var board = document.<portlet:namespace />fm.<portlet:namespace />board.value;
		var others = document.<portlet:namespace />fm.<portlet:namespace />others;
		var othersId = document.getElementById("othersId");
		
		if(board == "Others") {
			othersId.innerHTML="<liferay-ui:message key="Other_please_specify" /><font color='red'>*</font>";
			others.disabled = false;
			others.focus();
		}
		else {
			othersId.innerHTML="<liferay-ui:message key="Other_please_specify" />";
			others.disabled = true;
			others.value = '';
		}	
	}
	
	function enablecollStudentOthers() {
		var degree = document.<portlet:namespace />fm.<portlet:namespace />degree.value;
		var others = document.<portlet:namespace />fm.<portlet:namespace />others;
		var othersId = document.getElementById("othersId");
		
		if(degree == "Others") {
			othersId.innerHTML="<liferay-ui:message key="Other_please_specify" /><font color='red'>*</font>";
			others.disabled = false;
			others.focus();
		}
		else {
			othersId.innerHTML="<liferay-ui:message key="Other_please_specify" />";
			others.disabled = true;
			others.value = '';
		}	
	}
	
	function mainstayValidate()
	{
		var firstName = document.<portlet:namespace />fm.<portlet:namespace />firstName;
		var lastName = document.<portlet:namespace />fm.<portlet:namespace />lastName;
		var emailId = document.<portlet:namespace />fm.<portlet:namespace />emailId;
		var street1 = document.<portlet:namespace />fm.<portlet:namespace />street1;
		var countryId = document.getElementById('countryId');
		var regionId = document.getElementById('regionId');
		var cityId = document.getElementById('cityId');
		var pinCode = document.<portlet:namespace />fm.<portlet:namespace />pinCode;
		var contactNo = document.<portlet:namespace />fm.<portlet:namespace />contactNo;
		var loginName = document.<portlet:namespace />fm.<portlet:namespace />loginName;
		var community = document.<portlet:namespace />fm.<portlet:namespace />community;
		
		if((firstName.value==null)||(firstName.value=="")) {
			alert("Please Enter First Name");
			firstName.focus()
			return false;
		}
		
		if((lastName.value==null)||(lastName.value=="")) {
			alert("Please Enter Last Name");
			lastName.focus()
			return false;
		}
		
		if((emailId.value==null)||(emailId.value=="")) {
			alert("Please Enter your Email ID");
			emailId.focus()
			return false;
		}
		
		if (echeck(emailId.value)==false){
			emailId.focus()
			return false
		}
		
		if((street1.value==null)||(street1.value=="")) {
			alert("Please Enter your Street1");
			street1.focus()
			return false;
		}
		
		if((countryId.value==null)||(countryId.value=="")) {
			alert("Please Enter Country");
			countryId.focus()
			return false;
		}
		
		if((regionId.value==null)||(regionId.value=="")) {
			alert("Please Enter State");
			regionId.focus()
			return false;
		}
		
		if((cityId.value==null)||(cityId.value=="")) {
			alert("Please Enter City");
			cityId.focus()
			return false;
		}
		
		if((pinCode.value==null)||(pinCode.value=="")) {
			alert("Please Enter PinCode");
			pinCode.focus()
			return false;
		}
		
		if((contactNo.value==null)||(contactNo.value=="")) {
			alert("Please Enter Contact No");
			contactNo.focus()
			return false;
		}
		
		if((loginName.value==null)||(loginName.value=="")) {
			alert("Please Enter User Name");
			loginName.focus()
			return false;
		}
		
		if((community.value==null)||(community.value=="")) {
			alert("Please Enter Community Name");
			community.focus()
			return false;
		}
		
		return true;
	}
	
	function studentValidate() {
	
		var firstName = document.<portlet:namespace />fm.<portlet:namespace />firstName;
		var lastName = document.<portlet:namespace />fm.<portlet:namespace />lastName;
		var standard = document.<portlet:namespace />fm.<portlet:namespace />standard;
		var street1 = document.<portlet:namespace />fm.<portlet:namespace />street1;
		var countryId = document.getElementById('countryId');
		var regionId = document.getElementById('regionId');
		var cityId = document.getElementById('cityId');
		var pinCode = document.<portlet:namespace />fm.<portlet:namespace />pinCode;
		var contactNo = document.<portlet:namespace />fm.<portlet:namespace />contactNo;
		var loginName = document.<portlet:namespace />fm.<portlet:namespace />loginName;
		
		if((firstName.value==null)||(firstName.value=="")) {
			alert("Please Enter First Name");
			firstName.focus()
			return false;
		}
		
		if((lastName.value==null)||(lastName.value=="")) {
			alert("Please Enter Last Name");
			lastName.focus()
			return false;
		}
		
		if(standard.value == "select") {
			alert("Please Enter Standard");
			standard.focus()
			return false;
		}
		
		if((street1.value==null)||(street1.value=="")) {
			alert("Please Enter your Street1");
			street1.focus()
			return false;
		}
		
		if((countryId.value==null)||(countryId.value=="")) {
			alert("Please Enter Country");
			countryId.focus()
			return false;
		}
		
		if((regionId.value==null)||(regionId.value=="")) {
			alert("Please Enter State");
			regionId.focus()
			return false;
		}
		
		if((cityId.value==null)||(cityId.value=="")) {
			alert("Please Enter City");
			cityId.focus()
			return false;
		}
		
		if((pinCode.value==null)||(pinCode.value=="")) {
			alert("Please Enter PinCode");
			pinCode.focus()
			return false;
		}
		
		if((contactNo.value==null)||(contactNo.value=="")) {
			alert("Please Enter Contact No");
			contactNo.focus()
			return false;
		}
		
		if((loginName.value==null)||(loginName.value=="")) {
			alert("Please Enter User Name");
			loginName.focus()
			return false;
		}
		
		return true;
	}
	
	function guestValidate()
	{
		var firstName = document.<portlet:namespace />fm.<portlet:namespace />firstName;
		var lastName = document.<portlet:namespace />fm.<portlet:namespace />lastName;
		var emailId = document.<portlet:namespace />fm.<portlet:namespace />emailId;
		var street1 = document.<portlet:namespace />fm.<portlet:namespace />street1;
		var countryId = document.getElementById('countryId');
		var regionId = document.getElementById('regionId');
		var cityId = document.getElementById('cityId');
		var pinCode = document.<portlet:namespace />fm.<portlet:namespace />pinCode;
		var contactNo = document.<portlet:namespace />fm.<portlet:namespace />contactNo;
		var loginName = document.<portlet:namespace />fm.<portlet:namespace />loginName;
		
		if((firstName.value==null)||(firstName.value=="")) {
			alert("Please Enter First Name");
			firstName.focus()
			return false;
		}
		
		if((lastName.value==null)||(lastName.value=="")) {
			alert("Please Enter Last Name");
			lastName.focus()
			return false;
		}
		
		if((emailId.value==null)||(emailId.value=="")) {
			alert("Please Enter your Email ID");
			emailId.focus()
			return false;
		}
		
		if (echeck(emailId.value)==false){
			emailId.focus()
			return false
		}
		
		if((street1.value==null)||(street1.value=="")) {
			alert("Please Enter your Street1");
			street1.focus()
			return false;
		}
		
		if((countryId.value==null)||(countryId.value=="")) {
			alert("Please Enter Country");
			countryId.focus()
			return false;
		}
		
		if((regionId.value==null)||(regionId.value=="")) {
			alert("Please Enter State");
			regionId.focus()
			return false;
		}
		
		if((cityId.value==null)||(cityId.value=="")) {
			alert("Please Enter City");
			cityId.focus()
			return false;
		}
		
		if((pinCode.value==null)||(pinCode.value=="")) {
			alert("Please Enter PinCode");
			pinCode.focus()
			return false;
		}
		
		if((contactNo.value==null)||(contactNo.value=="")) {
			alert("Please Enter Contact No");
			contactNo.focus()
			return false;
		}
		
		if((loginName.value==null)||(loginName.value=="")) {
			alert("Please Enter User Name");
			loginName.focus()
			return false;
		}
		
		return true;
	}
	
	function parentValidate()
	{
		var firstName = document.<portlet:namespace />fm.<portlet:namespace />firstName;
		var lastName = document.<portlet:namespace />fm.<portlet:namespace />lastName;
		var relation = document.<portlet:namespace />fm.<portlet:namespace />relation;
		var emailId = document.<portlet:namespace />fm.<portlet:namespace />emailId;
		var street1 = document.<portlet:namespace />fm.<portlet:namespace />street1;
		var countryId = document.getElementById('countryId');
		var regionId = document.getElementById('regionId');
		var cityId = document.getElementById('cityId');
		var pinCode = document.<portlet:namespace />fm.<portlet:namespace />pinCode;
		var contactNo = document.<portlet:namespace />fm.<portlet:namespace />contactNo;
		var loginName = document.<portlet:namespace />fm.<portlet:namespace />loginName;
		
		if((firstName.value==null)||(firstName.value=="")) {
			alert("Please Enter First Name");
			firstName.focus()
			return false;
		}
		
		if((lastName.value==null)||(lastName.value=="")) {
			alert("Please Enter Last Name");
			lastName.focus()
			return false;
		}
		
		if(relation.value == "0") {
			alert("Please Enter Relation");
			relation.focus()
			return false;
		}
		
		if((emailId.value==null)||(emailId.value=="")) {
			alert("Please Enter your Email ID");
			emailId.focus()
			return false;
		}
		
		
		if (echeck(emailId.value)==false){
			emailId.focus()
			return false
		}
		
		if((street1.value==null)||(street1.value=="")) {
			alert("Please Enter your Street1");
			street1.focus()
			return false;
		}
		
		if((countryId.value==null)||(countryId.value=="")) {
			alert("Please Enter Country");
			countryId.focus()
			return false;
		}
		
		if((regionId.value==null)||(regionId.value=="")) {
			alert("Please Enter State");
			regionId.focus()
			return false;
		}
		
		if((cityId.value==null)||(cityId.value=="")) {
			alert("Please Enter City");
			cityId.focus()
			return false;
		}
		
		if((pinCode.value==null)||(pinCode.value=="")) {
			alert("Please Enter PinCode");
			pinCode.focus()
			return false;
		}
		
		if((contactNo.value==null)||(contactNo.value=="")) {
			alert("Please Enter Contact No");
			contactNo.focus()
			return false;
		}
		
		if((loginName.value==null)||(loginName.value=="")) {
			alert("Please Enter User Name");
			loginName.focus()
			return false;
		}
		
		return true;
	}
	
	function schoolValidate() {
	
		var name = document.<portlet:namespace />fm.<portlet:namespace />name;
		var street1 = document.<portlet:namespace />fm.<portlet:namespace />street1;
		var board = document.<portlet:namespace />fm.<portlet:namespace />board;
		var others = document.<portlet:namespace />fm.<portlet:namespace />others;
		var pinCode = document.<portlet:namespace />fm.<portlet:namespace />pinCode;
		var contactNo = document.<portlet:namespace />fm.<portlet:namespace />contactNo;
		var emailId = document.<portlet:namespace />fm.<portlet:namespace />emailId;
		var loginName = document.<portlet:namespace />fm.<portlet:namespace />loginName;
		var firstName = document.<portlet:namespace />fm.<portlet:namespace />firstName;
		var lastName = document.<portlet:namespace />fm.<portlet:namespace />lastName;
		var countryId = document.getElementById('countryId');
		var regionId = document.getElementById('regionId');
		var cityId = document.getElementById('cityId');
		var cpContactNo = document.<portlet:namespace />fm.<portlet:namespace />cpContactNo;
		
		if((name.value==null)||(name.value=="")) {
			alert("Please Enter your School Name");
			name.focus()
			return false;
		}
		
		if((street1.value==null)||(street1.value=="")) {
			alert("Please Enter your Street1");
			street1.focus()
			return false;
		}
		
		if(board.value == "select") {
			alert("Please Enter Board");
			board.focus()
			return false;
		}
		
		if((board.value == "Others") && (others.value ==""))  {
			alert("Please Enter Board");
			others.focus()
			return false;
		}
		
		if((countryId.value==null)||(countryId.value=="")) {
			alert("Please Enter Country");
			countryId.focus()
			return false;
		}
		
		if((regionId.value==null)||(regionId.value=="")) {
			alert("Please Enter State");
			regionId.focus()
			return false;
		}
		
		if((cityId.value==null)||(cityId.value=="")) {
			alert("Please Enter City");
			cityId.focus()
			return false;
		}
		
		if((pinCode.value==null)||(pinCode.value=="")) {
			alert("Please Enter PinCode");
			pinCode.focus()
			return false;
		}
		
		if((contactNo.value==null)||(contactNo.value=="")) {
			alert("Please Enter Contact No");
			contactNo.focus()
			return false;
		}
		
		if((emailId.value==null)||(emailId.value=="")) {
			alert("Please Enter your Email ID");
			emailId.focus()
			return false;
		}
		
		if (echeck(emailId.value)==false){
			emailId.focus()
			return false
		}
		
		if((pinCode.value==null)||(pinCode.value=="")) {
			alert("Please Enter PinCode");
			pinCode.focus()
			return false;
		}
		
		if((firstName.value==null)||(firstName.value=="")) {
			alert("Please Enter First Name");
			firstName.focus()
			return false;
		}
		
		if((lastName.value==null)||(lastName.value=="")) {
			alert("Please Enter Last Name");
			lastName.focus()
			return false;
		}
		
		if((cpContactNo.value==null)||(cpContactNo.value=="")) {
			alert("Please Enter Contact No");
			cpContactNo.focus()
			return false;
		}
		
		if((loginName.value==null)||(loginName.value=="")) {
			alert("Please Enter User Name");
			loginName.focus()
			return false;
		}
		
		if(name.value == loginName.value) {
		
			alert("School Name and User Name can not be same");
			loginName.focus();
			return false;
		}
		return true;
	}
	
	function teacherValidate()
	{
		var firstName = document.<portlet:namespace />fm.<portlet:namespace />firstName;
		var lastName = document.<portlet:namespace />fm.<portlet:namespace />lastName;
		var street1 = document.<portlet:namespace />fm.<portlet:namespace />street1;
		var emailId = document.<portlet:namespace />fm.<portlet:namespace />emailId;
		var countryId = document.getElementById('countryId');
		var regionId = document.getElementById('regionId');
		var cityId = document.getElementById('cityId');
		var pinCode = document.<portlet:namespace />fm.<portlet:namespace />pinCode;
		var contactNo = document.<portlet:namespace />fm.<portlet:namespace />contactNo;
		var loginName = document.<portlet:namespace />fm.<portlet:namespace />loginName;
		
		if((firstName.value==null)||(firstName.value=="")) {
			alert("Please Enter First Name");
			firstName.focus()
			return false;
		}
		
		if((lastName.value==null)||(lastName.value=="")) {
			alert("Please Enter Last Name");
			lastName.focus()
			return false;
		}
		
		if((street1.value==null)||(street1.value=="")) {
			alert("Please Enter your Street1");
			street1.focus()
			return false;
		}
		
		if((emailId.value==null)||(emailId.value=="")) {
			alert("Please Enter your Email ID");
			emailId.focus()
			return false;
		}
		
		if (echeck(emailId.value)==false){
			emailId.focus()
			return false
		}
		
		if((countryId.value==null)||(countryId.value=="")) {
			alert("Please Enter Country");
			countryId.focus()
			return false;
		}
		
		if((regionId.value==null)||(regionId.value=="")) {
			alert("Please Enter State");
			regionId.focus()
			return false;
		}
		
		if((cityId.value==null)||(cityId.value=="")) {
			alert("Please Enter City");
			cityId.focus()
			return false;
		}
		
		if((pinCode.value==null)||(pinCode.value=="")) {
			alert("Please Enter PinCode");
			pinCode.focus()
			return false;
		}
		
		if((contactNo.value==null)||(contactNo.value=="")) {
			alert("Please Enter Contact No");
			contactNo.focus()
			return false;
		}
		
		if((loginName.value==null)||(loginName.value=="")) {
			alert("Please Enter Login Name");
			loginName.focus()
			return false;
		}
		return true;
	}
	
	function collegevalidate() {
	
		var name = document.<portlet:namespace />fm.<portlet:namespace />name;
		var street1 = document.<portlet:namespace />fm.<portlet:namespace />street1;
		var university = document.<portlet:namespace />fm.<portlet:namespace />university;
		var others = document.<portlet:namespace />fm.<portlet:namespace />others;
		var pinCode = document.<portlet:namespace />fm.<portlet:namespace />pinCode;
		var contactNo = document.<portlet:namespace />fm.<portlet:namespace />contactNo;
		var emailId = document.<portlet:namespace />fm.<portlet:namespace />emailId;
		var loginName = document.<portlet:namespace />fm.<portlet:namespace />loginName;
		var firstName = document.<portlet:namespace />fm.<portlet:namespace />firstName;
		var lastName = document.<portlet:namespace />fm.<portlet:namespace />lastName;
		var countryId = document.getElementById('countryId');
		var regionId = document.getElementById('regionId');
		var cityId = document.getElementById('cityId');
		var cpContactNo = document.<portlet:namespace />fm.<portlet:namespace />cpContactNo;
		
		if((name.value==null)||(name.value=="")) {
			alert("Please Enter your College Name");
			name.focus()
			return false;
		}
		
		if((street1.value==null)||(street1.value=="")) {
			alert("Please Enter your Street1");
			street1.focus()
			return false;
		}
		
		if(university.value == "select") {
			alert("Please Enter University");
			university.focus()
			return false;
		}
						
		if((countryId.value==null)||(countryId.value=="")) {
			alert("Please Enter Country");
			countryId.focus()
			return false;
		}
		
		if((regionId.value==null)||(regionId.value=="")) {
			alert("Please Enter State");
			regionId.focus()
			return false;
		}
		
		if((cityId.value==null)||(cityId.value=="")) {
			alert("Please Enter City");
			cityId.focus()
			return false;
		}
		
		if((pinCode.value==null)||(pinCode.value=="")) {
			alert("Please Enter PinCode");
			pinCode.focus()
			return false;
		}
		
		if((contactNo.value==null)||(contactNo.value=="")) {
			alert("Please Enter Contact No");
			contactNo.focus()
			return false;
		}
		
		if((cpEmailAddress.value==null)||(cpEmailAddress.value=="")) {
			alert("Please Enter your Email ID");
			cpEmailAddress.focus()
			return false;
		}
		
		if (echeck(cpEmailAddress.value)==false){
			cpEmailAddress.focus()
			return false
		}
		
		if((pinCode.value==null)||(pinCode.value=="")) {
			alert("Please Enter PinCode");
			pinCode.focus()
			return false;
		}
		
		if((firstName.value==null)||(firstName.value=="")) {
			alert("Please Enter First Name");
			firstName.focus()
			return false;
		}
		
		if((lastName.value==null)||(lastName.value=="")) {
			alert("Please Enter Last Name");
			lastName.focus()
			return false;
		}
		
		if((cpContactNo.value==null)||(cpContactNo.value=="")) {
			alert("Please Enter Contact No");
			cpContactNo.focus()
			return false;
		}
		
		if((loginName.value==null)||(loginName.value=="")) {
			alert("Please Enter User Name");
			loginName.focus()
			return false;
		}
		
		return true;
	}
	
	function collStudentvalidate() {
	
		var firstName = document.<portlet:namespace />fm.<portlet:namespace />firstName;
		var lastName = document.<portlet:namespace />fm.<portlet:namespace />lastName;
		var standard = document.<portlet:namespace />fm.<portlet:namespace />standard;
		var degree = document.<portlet:namespace />fm.<portlet:namespace />degree;
		var street1 = document.<portlet:namespace />fm.<portlet:namespace />street1;
		var countryId = document.getElementById('countryId');
		var regionId = document.getElementById('regionId');
		var cityId = document.getElementById('cityId');
		var pinCode = document.<portlet:namespace />fm.<portlet:namespace />pinCode;
		var contactNo = document.<portlet:namespace />fm.<portlet:namespace />contactNo;
		var loginName = document.<portlet:namespace />fm.<portlet:namespace />loginName;
		
		if((firstName.value==null)||(firstName.value=="")) {
			alert("Please Enter First Name");
			firstName.focus()
			return false;
		}
		
		if((lastName.value==null)||(lastName.value=="")) {
			alert("Please Enter Last Name");
			lastName.focus()
			return false;
		}
		
		if(standard.value == "select") {
			alert("Please Enter Standard");
			standard.focus()
			return false;
		}
		if(degree.value == "select") {
			alert("Please Enter Degree");
			degree.focus()
			return false;
		}
		
		if((degree.value == "Others") && (others.value ==""))  {
			alert("Please Enter Degree");
			others.focus()
			return false;
		}
		
		if((street1.value==null)||(street1.value=="")) {
			alert("Please Enter your Street1");
			street1.focus()
			return false;
		}
		
		if((countryId.value==null)||(countryId.value=="")) {
			alert("Please Enter Country");
			countryId.focus()
			return false;
		}
		
		if((regionId.value==null)||(regionId.value=="")) {
			alert("Please Enter State");
			regionId.focus()
			return false;
		}
		
		if((cityId.value==null)||(cityId.value=="")) {
			alert("Please Enter City");
			cityId.focus()
			return false;
		}
		
		if((pinCode.value==null)||(pinCode.value=="")) {
			alert("Please Enter PinCode");
			pinCode.focus()
			return false;
		}
		
		if((contactNo.value==null)||(contactNo.value=="")) {
			alert("Please Enter Contact No");
			contactNo.focus()
			return false;
		}
		
		if((loginName.value==null)||(loginName.value=="")) {
			alert("Please Enter User Name");
			loginName.focus()
			return false;
		}
		
		return true;
	}
	
	function staffvalidate()
	{
		var firstName = document.<portlet:namespace />fm.<portlet:namespace />firstName;
		var lastName = document.<portlet:namespace />fm.<portlet:namespace />lastName;
		var street1 = document.<portlet:namespace />fm.<portlet:namespace />street1;
		var emailId = document.<portlet:namespace />fm.<portlet:namespace />emailId;
		var countryId = document.getElementById('countryId');
		var regionId = document.getElementById('regionId');
		var cityId = document.getElementById('cityId');
		var pinCode = document.<portlet:namespace />fm.<portlet:namespace />pinCode;
		var contactNo = document.<portlet:namespace />fm.<portlet:namespace />contactNo;
		var loginName = document.<portlet:namespace />fm.<portlet:namespace />loginName;
		
		if((firstName.value==null)||(firstName.value=="")) {
			alert("Please Enter First Name");
			firstName.focus()
			return false;
		}
		
		if((lastName.value==null)||(lastName.value=="")) {
			alert("Please Enter Last Name");
			lastName.focus()
			return false;
		}
		
		if((street1.value==null)||(street1.value=="")) {
			alert("Please Enter your Street1");
			street1.focus()
			return false;
		}
		
		if((emailId.value==null)||(emailId.value=="")) {
			alert("Please Enter your Email ID");
			emailId.focus()
			return false;
		}
		
		if (echeck(emailId.value)==false){
			emailId.focus()
			return false
		}
		
		if((countryId.value==null)||(countryId.value=="")) {
			alert("Please Enter Country");
			countryId.focus()
			return false;
		}
		
		if((regionId.value==null)||(regionId.value=="")) {
			alert("Please Enter State");
			regionId.focus()
			return false;
		}
		
		if((cityId.value==null)||(cityId.value=="")) {
			alert("Please Enter City");
			cityId.focus()
			return false;
		}
		
		if((pinCode.value==null)||(pinCode.value=="")) {
			alert("Please Enter PinCode");
			pinCode.focus()
			return false;
		}
		
		if((contactNo.value==null)||(contactNo.value=="")) {
			alert("Please Enter Contact No");
			contactNo.focus()
			return false;
		}
		
		if((loginName.value==null)||(loginName.value=="")) {
			alert("Please Enter Login Name");
			loginName.focus()
			return false;
		}
		return true;
	}
	
	function collOthersvalidate()
	{
		var firstName = document.<portlet:namespace />fm.<portlet:namespace />firstName;
		var lastName = document.<portlet:namespace />fm.<portlet:namespace />lastName;
		var emailId = document.<portlet:namespace />fm.<portlet:namespace />emailId;
		var street1 = document.<portlet:namespace />fm.<portlet:namespace />street1;
		var countryId = document.getElementById('countryId');
		var regionId = document.getElementById('regionId');
		var cityId = document.getElementById('cityId');
		var pinCode = document.<portlet:namespace />fm.<portlet:namespace />pinCode;
		var contactNo = document.<portlet:namespace />fm.<portlet:namespace />contactNo;
		var loginName = document.<portlet:namespace />fm.<portlet:namespace />loginName;
		
		if((firstName.value==null)||(firstName.value=="")) {
			alert("Please Enter First Name");
			firstName.focus()
			return false;
		}
		
		if((lastName.value==null)||(lastName.value=="")) {
			alert("Please Enter Last Name");
			lastName.focus()
			return false;
		}
		
		if((emailId.value==null)||(emailId.value=="")) {
			alert("Please Enter your Email ID");
			emailId.focus()
			return false;
		}
		
		if (echeck(emailId.value)==false){
			emailId.focus()
			return false;
		}
		
		if((street1.value==null)||(street1.value=="")) {
			alert("Please Enter your Street1");
			street1.focus()
			return false;
		}
		
		if((countryId.value==null)||(countryId.value=="")) {
			alert("Please Enter Country");
			countryId.focus()
			return false;
		}
		
		if((regionId.value==null)||(regionId.value=="")) {
			alert("Please Enter State");
			regionId.focus()
			return false;
		}
		
		if((cityId.value==null)||(cityId.value=="")) {
			alert("Please Enter City");
			cityId.focus()
			return false;
		}
		
		if((pinCode.value==null)||(pinCode.value=="")) {
			alert("Please Enter PinCode");
			pinCode.focus()
			return false;
		}
		
		if((contactNo.value==null)||(contactNo.value=="")) {
			alert("Please Enter Contact No");
			contactNo.focus()
			return false;
		}
		
		if((loginName.value==null)||(loginName.value=="")) {
			alert("Please Enter User Name");
			loginName.focus()
			return false;
		}
		
		return true;
	}
	
	
</script>